//遮罩窗生成模块
define('modal_template', ['handlebars', 'jquery'], function(Handlebars, $){
	return function(){
		var source = $('#modal-template').html();
		var template = Handlebars.compile(source);

		var log = {
			"title": "登录",
			"input": [
				{
					"name": "logEmail",
					"input-type": "email",
					"label": "邮箱"
				},
				{
					"name": "logPassword",
					"input-type": "password",
					"label": "密码"
				}
			],
			"button": "登录",
			"other": true
		};
		//$('#logModal').html(template(log));

		var reg = {
			"title": "注册",
			"input": [
				{
					"name": "regEmail",
					"input-type": "email",
					"label": "邮箱"
				},
				{
					"name": "regPassword",
					"input-type": "password",
					"label": "密码"
				},
				{
					"radio": true,
					"name": "regIsTeacher",
					"label": "学生或老师",
					"value0": "学生",
					"value1": "老师"
				}
			],
			"button": "注册",
			"other": true
		};	
		//$('#regModal').html(template(reg));

		var changePass = {
			"title": "修改用户密码",
			"input": [
				{
					"name": "oldPassword",
					"input-type": "password",
					"label": "旧密码"
				},
				{
					"name": "changePassword1",
					"input-type": "password",
					"label": "新密码"
				},
				{
					"name": "changePassword2",
					"input-type": "password",
					"label": "再次输入"
				}
			],
			"button": "修改"
		};
		//$('#changePassModal').html(template(changePass));

		var updateInfo = {
			"title": "修改个人信息",
			"input": [
				{
					"name": "updateName",
					"input-type": "text",
					"label": "用户名"
				},
				{
					"radio": true,
					"name": "updateGender",
					"label": "性别",
					"value0": "女",
					"value1": "男" 
				},
				{
					"select": true,
					"name": "updateGrade",
					"label": "年级",
					"options": [
						{"value": 0, "content": "初中"},
						{"value": 1, "content": "高一"},
						{"value": 2, "content": "高二"},
						{"value": 3, "content": "高三"},
						{"value": 4, "content": "大学"},
						{"value": 5, "content": "业余"}
					]
				},
				{
					"name": "updateProvince",
					"input-type": "text",
					"label": "省份"
				},
				{
					"name": "updateCity",
					"input-type": "text",
					"label": "城市"
				},
				{
					"name": "updatePhone",
					"input-type": "text",
					"label": "电话"
				},
				{
					"name": "updateSchool",
					"input-type": "text",
					"label": "学校"
				},
				{
					"file": true,
				}
			],
			"button": "修改"
		};
		//$('#updateInfoModal').html(template(updateInfo));
	};
});